package com.cfh.web;

import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

public class IndexAction extends ActionSupport implements SessionAware {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(IndexAction.class);

	private static final long serialVersionUID = 1L;
	private Map session;

	public void setSession(Map map) {
		session = map;
	}

	private String from;
	public IndexAction() {
		super();

	}

	/***
	 * nouse
	 */
	public String execute() {
		if(logger.isDebugEnabled()){
			logger.debug("execute() - start"); //$NON-NLS-1$
		}
		
		
		if(logger.isDebugEnabled()){
			logger.debug("execute()"); //$NON-NLS-1$
		}
		if(!StringUtils.isEmpty(from)){
			session.put("FROM", from);
			logger.debug("execute()"); //$NON-NLS-1$
		}

		if(logger.isDebugEnabled()){
			logger.debug("execute() - end"); //$NON-NLS-1$
		}
		return SUCCESS;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public String getFrom() {
		return from;
	}

}
